home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / DB_CLIPP / 0643B.ZIP / LPTX.DOC < prev    next >
Text File  |  1994-01-01  |  6KB  |  135 lines

  1. LPTx : Line Printer Output Capture Routine
  2.  
  3. -------------------------------------------------------------
  4.  
  5.  Version 3.0
  6.  
  7.  (C)    Copyright 1985 by Mark DiVecchio, All Rights Reserved
  8.  
  9.  You may use and freely distribute this program for
  10.  non-commercial applications.
  11.  
  12.  Mark C. DiVecchio
  13.  9067 Hillery Drive
  14.  San Diego, CA 92126
  15.  619-566-6810
  16. -------------------------------------------------------------
  17.  
  18.     Have you ever wanted to get some data from your screen into a
  19. program? Have you ever wanted to grab onto some printer data and put it into
  20. a disk file but the program you are using does not have that as a option?
  21. Well here is the answer to your problem. This program will grab onto
  22. anything sent out of a line printer port as long as the program uses the
  23. standard BIOS INT 17h call. I have tried this with printscreen, with
  24. printscreen in graphics mode (produces some mighty unusual output),  with
  25. SIDEWAYS, with the copy command to LPT1: etc, with my word processor
  26. (FinalWord), with MASM (direct output to LPT1) with Wordstar, with 1-2-3 and
  27. with the DOS '>' redirection command line option. It all seems to work.
  28.  
  29.     This program intercepts the BIOS interrupt 17, the line printer
  30. interrupt. It will redirect the output of LPT1, LPT2, or LPT3 to a disk
  31. file. All three redirections may be active at the same time.
  32.  
  33.     LPTx requires DOS 2.0 or later.
  34.  
  35. Calling sequence:
  36. lptx -1 -o <d:[pathname]filename>
  37.  
  38. where -1 means redirect LPT1, -2 means redirect LPT2, -3 means redirect
  39.      LPT3
  40.      This option must appear first
  41.  
  42.       -o means start the redirection to file specified. If redirection
  43.          is already in progress for the selected line printer,
  44.      the old file will be closed first.
  45.      (If you do not specify -o but you do specify a line printer,
  46.      LPTx will use either the last file name that you gave when
  47.      you loaded LPTx or will use the file named LPTXy.LST which it
  48.      will create in the root directory on the default drive - where
  49.      y is 1, 2, or 3.)
  50.  
  51.      It is not necessary that you specify the complete path name
  52.      for the file. LPTx will create the file in the default 
  53.      directory if you don't specify a directory. LPTx will always
  54.      be able to find the file because it saves the complete path.
  55.  
  56.     -c means close the file and send all further output directly to the
  57.      line printer.
  58.  
  59. If neither option is specified, LPTx just displays the program status.
  60.  
  61. note: -1, -2, and -3 are mutually exclusive
  62.       -o and -c are mutually exclusive
  63.  
  64. examples:
  65.  
  66. lptx                Displays the program status
  67.  
  68. lptx ?                Displays a HELP screen
  69.  
  70. lptx -1                redirects LPT1 output to file named
  71.                 LPTX1.LST in the root directory
  72.                 on the default drive or the last
  73.                 named file.
  74.  
  75. lptx -o a:\able.xxx        redirects LPT1 output to file named
  76.     or            a:\able.xxx. Any open redirection
  77. lptx a:\able.xxx        disk file for LPT1 is closed.
  78.  
  79. lptx -2 b:xx.lst        redirects LPT2 output to file named
  80.                 XX.LST in the default directory
  81.                 on drive B:. Any open redirection
  82.                 disk file for LPT2 is closed.
  83.  
  84. lptx -3 d:\ab\cd\file.lst    redirects LPT3 output to the file named
  85.                 file.lst in the directory ab\cd on drive
  86.                 d:.
  87.  
  88. lptx -c                closes any disk files open for LPT1 and sends
  89.     or            the output back to the line printer
  90. lptx -1 -c            If no redirection is taking place to LPT1,
  91.                 this is    a NOP. LPT2 and LPT3 are not
  92.                 affected.
  93.  
  94. lptx -2 -c            closes any disk file open for LPT2 and
  95.                 sends the output back to line printer.
  96.                 if no redirection is taking place to LPT2,
  97.                 this is a NOP. LPT1 and LPT3 are not
  98.                 affected.
  99.  
  100.     By redirecting LPT2 or LPT3 to a disk file, you can in effect have 2
  101. or 3 printers on your system. LPT1 can be your physical printer and you can
  102. have LPT2 output going to disk. When you redirect LPT2 or LPT3, LPT1 works
  103. normally.
  104.  
  105.     If you are redirecting to a diskette file, do not remove the diskette
  106. once the redirection starts. I recommend redirecting to a hard disk or a RAM
  107. disk.
  108.  
  109.     If LPTx encounters any kind of error during the redirection, it
  110. terminates operation and sends output back to the line printer. It does not
  111. display anything but beeps the speaker four times. This prevents your
  112. currently running program from possibly getting destroyed. An error with
  113. LPT1 redirection does not shut down LPT2 or LPT3 redirection.
  114.  
  115.     LPTx captures the int 17h interrupt vector. Problems may occur with
  116. print spoolers which also take over the int 17h  vector. You can be sure that
  117. LPTX works correctly by running LPTX after you have run your print spooler.
  118. LPTX will be transparent to the print spooler but your print spooler may not
  119. be transparent to LPTX. LPTX works fine with IBM's PRINT command.
  120.  
  121.     LPTx also captures the int 24h critical error interrupt vector. This
  122. is done only for the period that LPTx is using the disk. This prevents the
  123. generation of funny error messages in the middle of other programs that you
  124. may be running. (LPTx just beeps 4 times and clears itself out of way if a
  125. disk error occurs).
  126.  
  127.     This version of LPTx can redirect all three printers to three
  128. different files with all 3 active at the same time.
  129.  
  130.     LPTx uses about 7K of memory for the resident data buffers and
  131. interrupt handler.
  132.  
  133.     If you modify or find any bugs in this program, I would appreciate
  134. it if you would drop me a line with the changes. Use the address above. 
  135.